<?
include("../com.inc.php");
if($_SESSION['memberID']!=1 && !($_SESSION['sid']==1 && strpos($_SESSION['qx'],'fees'))){
exit("<script>window.location='dlogin.html'</script>");}
$fee_platform=$_REQUEST["fee_platform"];
$fee_bank=$_REQUEST["fee_bank"];
$fee_sms=$_REQUEST["fee_sms"];
$fee_code=$_REQUEST["fee_code"];
$fee_pay_way=$_REQUEST["fee_pay_way"];
foreach($fee_platform as $k=>$v){
	if(filter_var($v, FILTER_VALIDATE_FLOAT)===false){
		echo "<script>alert('平台使用费存在非法字符!')</script>";
		exit;
	}
	if(filter_var($fee_bank[$k], FILTER_VALIDATE_INT)===false){
		echo "<script>alert('支付手续费用存在非法字符!')</script>";
		exit;
	}
	if(filter_var($fee_sms[$k], FILTER_VALIDATE_FLOAT)===false){
		echo "<script>alert('短信收费存在非法字符!')</script>";
		exit;
	}
	if(filter_var($fee_code[$k], FILTER_VALIDATE_FLOAT)===false){
		echo "<script>alert('电子凭证费存在非法字符!')</script>";
		exit;
	}
	if(filter_var($fee_pay_way[$k], FILTER_VALIDATE_INT)===false){
		echo "<script>alert('费用收取方存在非法字符!')</script>";
		exit;
	}
}
foreach($fee_platform as $k=>$v){
	$upd="update pft_member set fee_platform=".($v*100).",fee_bank=".$fee_bank[$k].",fee_sms=".($fee_sms[$k]*100).",fee_code=".($fee_code[$k]*100).",fee_pay_way=".$fee_pay_way[$k]." where id=".$k." limit 1";//echo $upd;
	$GLOBALS['le']->query($upd);
}
echo "<script>alert('配置成功')</script>";
?>